# Contributor: Elias Werberich <elias@werberich.de>
# Maintainer: Noel Kuntze <noel.kuntze@thermi.consulting>
pkgname=amavisd-milter
pkgver=1.7.0
pkgrel=0
pkgdesc="sendmail milter for amavisd-new using the AM.PDP protocol"
url="http://amavisd-milter.sourceforge.net/"
arch="all !x86" #amavis isn't build for x86
license="BSD-3-Clause"
depends="amavis libmilter"
makedepends="libmilter-dev"
subpackages="$pkgname-doc"
source="
	https://github.com/prehor/amavisd-milter/releases/download/$pkgver/amavisd-milter-$pkgver.tar.gz
	amavisd-milter.initd
	amavisd-milter.confd
	"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--target="" \
		--prefix=/usr
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install

	install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname

	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="52fdfe4acdd94e387de63d93aa3347dce46e7e16b8ab51679c7bbfc4f6faba160de5ca55aae141cbd06f3d9d1122dea67fdd67562dd5b8314055f7f6071545af  amavisd-milter-1.7.0.tar.gz
3e45a8766f6b5bbb089bcb508efe99d17f107d544b2d50d12437a6b7103e2ce143eef9c6ecc0e2a9ced37b153d122e1eb8f171e4000e4e56a7f2a210587c2d68  amavisd-milter.initd
f44ab528c65050e23a2e78dafd937dae5bc73bd83ff780d7a193d47744674f3991c9d1ae99c4fb8ce1762c50ed6ca5fb604eb2c4cf69fe2e27e8a4076b6f2eec  amavisd-milter.confd"
